﻿<metro:Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:Controls="clr-namespace:Elysium.Controls;assembly=Elysium"
        xmlns:params="http://schemas.codeplex.com/elysium/params"
        xmlns:Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
    
        xmlns:local="clr-namespace:SynTorrent" 
        xmlns:metro="http://schemas.codeplex.com/elysium"
        xmlns:SynologyWebApi="clr-namespace:SynologyWebApi;assembly=SynologyWebApi"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
        xmlns:System="clr-namespace:System;assembly=mscorlib" x:Name="window" 
        mc:Ignorable="d"
    
        params:Design.Theme="Dark" 
        params:Manager.Theme="Dark" 
    
        x:Class="SynTorrent.MainWindow" 
        Height="586" Width="1009" 
        Title="SynTorrent - Synology Download Station Manager"
        Background="{DynamicResource BackgroundBrush}"
        Foreground="{DynamicResource ForegroundBrush}" 
        ResizeMode="CanResizeWithGrip" 
        metro:Window.IsMainWindow="True" 
        Closing="Window_Closing" 
        StateChanged="Window_StateChanged" Loaded="window_Loaded">

    <metro:Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Styles/Simple Styles.xaml"/>
            </ResourceDictionary.MergedDictionaries>
            <System:Double x:Key="IconHeight">55</System:Double>
        </ResourceDictionary>
    </metro:Window.Resources>

    <!-- Title bar -->
    <metro:Window.TitleBar>
        <Grid FlowDirection="RightToLeft">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <!--             <Button x:Name="TitleBarSettingsButton" Grid.Column="2" -->
            <!--                     Style="{DynamicResource {x:Static metro:Window.DefaultCaptionButtonStyleKey}}"  -->
            <!--                     Content="Settings" Click="TitleBarSettingsButton_Click"/> -->
        </Grid>
    </metro:Window.TitleBar>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition Height="0*"/>
        </Grid.RowDefinitions>
        <ToolBarPanel HorizontalAlignment="Left" Height="56" Width="740" Orientation="Horizontal" VerticalAlignment="Top" Margin="10,10,0,0">
            <Button x:Name="AddButton" Style="{DynamicResource SimpleButton}" Width="75" Click="AddButton_Click" ToolTip="Add new download task">
                <StackPanel>
                    <local:AutoGreyableImage Source="Images/AddTask.ico" Height="{DynamicResource IconHeight}"/>
                </StackPanel>
            </Button>
            <Button x:Name="PauseButton" Style="{DynamicResource SimpleButton}" Height="56" VerticalAlignment="Top" Width="75" ToolTip="Pause selected download tasks" Click="PauseButton_Click" IsEnabled="False">
                <StackPanel>
                    <local:AutoGreyableImage Source="Images/Pause.ico" Height="{DynamicResource IconHeight}"/>
                </StackPanel>
            </Button>
            <Button x:Name="ResumeButton" Style="{DynamicResource SimpleButton}" Height="56" VerticalAlignment="Top" Width="75" ToolTip="Resume selected download tasks" Click="ResumeButton_Click" IsEnabled="False">
                <StackPanel>
                    <local:AutoGreyableImage Source="Images/Resume.ico" Height="{DynamicResource IconHeight}"/>
                </StackPanel>
            </Button>
            <Button x:Name="DeleteButton" Style="{DynamicResource SimpleButton}" Height="56" VerticalAlignment="Top" Width="75" ToolTip="Remove selected download tasks" IsEnabled="False" Click="DeleteButton_Click">
                <StackPanel>
                    <local:AutoGreyableImage Source="Images/Delete.ico" Height="{DynamicResource IconHeight}"/>
                </StackPanel>
            </Button>
        </ToolBarPanel>
        <StatusBar VerticalAlignment="Bottom" Height="53" RenderTransformOrigin="0.5,0.5"
			Background="{DynamicResource AccentBrush}"
			Foreground="{DynamicResource ForegroundBrush}" 
			Margin="10,0,10,10">
            <Grid Height="43" Width="972">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="35*"/>
                    <ColumnDefinition Width="208*"/>
                </Grid.ColumnDefinitions>
                <TextBlock x:Name="FilterStatsLabel" Margin="10,0,0,-1" RenderTransformOrigin="0.5,0.5" TextAlignment="Right" TextWrapping="Wrap" Text="Filtered Stats"/>
                <local:TaskListStatisticsControl x:Name="StatsControl" Grid.Column="1" HorizontalAlignment="Left" Margin="10,0,0,0" Height="Auto" Width="656"/>
            </Grid>
        </StatusBar>
        <Grid Margin="10,71,10,68">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="250" MaxWidth="300" MinWidth="24"/>
                <ColumnDefinition Width="5"/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <GridSplitter Grid.Column="1" HorizontalAlignment="Stretch" Background="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}"/>
            <local:TaskListControl x:Name="TaskListControl" Grid.Column="2"/>
            <Grid Margin="0,0,0.4,0" >
                <Grid.RowDefinitions>
                    <RowDefinition/>
                    <RowDefinition/>
                </Grid.RowDefinitions>
                <local:FilterTreeControl x:Name="FilterControl" Width="Auto" SearchFieldEdited="FilterControl_SearchFieldEdited" Height="Auto"/>
                <local:SessionsControl x:Name="SessionsControl" Width="Auto" Height="Auto" Margin="0,10,0,-0.2" Grid.Row="1"/>
            </Grid>
        </Grid>
    </Grid>
</metro:Window>
